package com.restaurant.application.indexes.bookingsetlist.support;

import com.nebutown.base.ViewSpec;
import com.nebutown.base.data.ViewUpdate;
import com.nebutown.description.data.UnitForGeneration;
import com.nebutown.generation.PickableBean;
import com.nebutown.supporthome.AbstractBase;
import com.nebutown.supporthome.CmdCapsule;
import com.restaurant.application.bookingset.support.BookingSetData;
import com.restaurant.application.indexes.bookingsetlist.AssistBookingSetListImpl;

public class AssistBookingSetListBase extends AbstractBase {
    private UnitForGeneration desc = new UnitForGeneration();

    public AbstractAssistBookingSetList getImpl() {
        AbstractAssistBookingSetList inst = new AssistBookingSetListImpl();
        inst.setBase(this, getEscort());
        return inst;
    }

    @Override
    public AssistBookingSetListOutFace getUnitFace() {
        return new AssistBookingSetListOutFace(this);
    }

    @Override
    protected Object callDistr(String name, Object... param) {
        switch (name) {
            case "findBookingSetList":
                return getImpl().findBookingSetList((String) param[0], (String) param[1]);
            case "findBookingSetListByService":
                return getImpl().findBookingSetListByService((String) param[0]);
            case "checkIsRepeat":
                return getImpl().checkIsRepeat((BookingSetData) param[0]);
            case "findBookingShops":
                return getImpl().findBookingShops();
            case "getId":
                return getImpl().getId();
            case "getEffectiveInterface":
                return getImpl().getEffectiveInterface();
            case "getFullView":
                setIsRefresher();
                return getImpl().getFullView();
            case "getViewLead":
                return getImpl().getViewLead((ViewSpec) param[0]);
        }
        return null;
    }

    @Override
    protected boolean authDistr(String name) {
        switch (name) {
        }
        return true;
    }

    @Override
    public CmdCapsule getUICall(int cmd) {
        switch (cmd) {
            case 0:
                return AbstractAssistBookingSetList.CMD_CREATE;
            case 1:
                return AbstractAssistBookingSetList.CMD_EDIT;
            case 2:
                return AbstractAssistBookingSetList.CMD_DELETE;
            case 3:
                return AbstractAssistBookingSetList.CMD_SEARCH;
            case 4:
                return AbstractAssistBookingSetList.CMD_SWITCHPAGE;
        }
        return null;
    }

    @Override
    public ViewUpdate uiCall(int cmd, PickableBean param, int... seq) {
        switch (cmd) {
            case 0:
                return getImpl().create(seq);
            case 1:
                return getImpl().edit(seq);
            case 2:
                return getImpl().delete(seq);
            case 3:
                return getImpl().search(seq);
            case 4:
                return getImpl().switchPage(seq);
        }
        return null;
    }
}
